From: Keir Fraser Date: Mon, 27 Oct 2008 10:49:20 +0000 (+0000) Subject: x86_32: Lock in map_domain_page() may be taken with IRQs disabled, and X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14054^2~33 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22%22/%22http:/www.example.com/cgi/%22https:/%22%22?a=commitdiff_plain;h=a932eedd3d7c6d60e207492d7d83d4e60a2989a3;p=xen.git x86_32: Lock in map_domain_page() may be taken with IRQs disabled, and hence must *always* disable IRQs. Signed-off-by: Keir Fraser --- diff --git a/xen/arch/x86/x86_32/domain_page.c b/xen/arch/x86/x86_32/domain_page.c index 10f807b3e3..2fe2e562c4 100644 --- a/xen/arch/x86/x86_32/domain_page.c +++ b/xen/arch/x86/x86_32/domain_page.c @@ -43,7 +43,7 @@ static inline struct vcpu *mapcache_current_vcpu(void) void *map_domain_page(unsigned long mfn) { unsigned long va; - unsigned int idx, i; + unsigned int idx, i, flags; struct vcpu *v; struct mapcache_domain *dcache; struct mapcache_vcpu *vcache; @@ -69,7 +69,7 @@ void *map_domain_page(unsigned long mfn) goto out; } - spin_lock(&dcache->lock); + spin_lock_irqsave(&dcache->lock, flags); /* Has some other CPU caused a wrap? We must flush if so. */ if ( unlikely(dcache->epoch != vcache->shadow_epoch) ) @@ -105,7 +105,7 @@ void *map_domain_page(unsigned long mfn) set_bit(idx, dcache->inuse); dcache->cursor = idx + 1; - spin_unlock(&dcache->lock); + spin_unlock_irqrestore(&dcache->lock, flags); l1e_write(&dcache->l1tab[idx], l1e_from_pfn(mfn, __PAGE_HYPERVISOR));